package com.dragon.refect.classload;

/**
 * 字段解析演示案例
 *
 * @author dragon
 * @since 2019/11/14
 */
public class FieldResolution {
    
    interface Interface0 {
        int A = 0;
    }
    
    interface Interface1 extends Interface0 {
        int A = 1;
    }
    
    interface Interface2 {
        int A = 2;
    }
    
    static class Parent implements Interface1 {
        public static int A = 3;
    }
    
    static class Sub extends Parent implements Interface2 {
        /*
         * 如果注释掉下面这行语句，则会发生编译不通过，因为如果有一个同名字段同时出现在Sub的接口和父类中，那编译器会拒绝编译
         */
        public static int A = 4;
    }

    public static void main(String[] args) {
        System.out.println(Sub.A);
    }
}
